<?php
class utils{
	
	public function get_activity_status($activity)
	{
		$curtime = time();
		$starttime = strtotime($activity["act_date"]." ".$activity["act_start_time"]);
		$endtime = strtotime($activity["act_date"]." ".$activity["act_end_time"]);
		// echo $curtime . " - " .$starttime . " - ".$endtime ;
		// echo $activity["act_date"]." ".$activity["act_start_time"] ;
		if($curtime < $starttime)
		{
			return 0;//即将开始
		}else if($curtime >= $starttime && $curtime < $endtime)
		{
			return 1;//进行中
		}else{
			return 2;//已结束
		}
	}
}
?>
